The present invention relates to a technique for controlling computer programs.
An enterprise information system comprises a plurality of transaction programs for performing transactions such as purchase and remittance peculiar to an enterprise. Each of the transaction programs is generally composed of a plurality of processing steps. A part of the processing steps is common to the plurality of transaction programs. Such a part of the processing steps is separated as a component from each of the transaction programs so that it can be used in common to the plurality of transaction programs.
A technique for using such components generally and efficiently is called xe2x80x9ccomponent techniquexe2x80x9d. Use of the component technique permits buying and selling of components as circulating parts. Moreover, such components can be used so efficiently that a plurality of components are generated on a memory in accordance with a request from a transaction program or deleted from the memory automatically when the transaction program need not use the plurality of components. Typical examples of the component technique are an Enterprise Java Beans (EJB) technique, a Common Object Request Broker Architecture Component Model (CCM) technique, and a Component Object Model (COM) technique. The EJB technique is provided by Sun Microsystems Inc. in U.S.A. (see Enterprise Java Beans Specification v1.1, Public Release, Sun Microsystems Inc., Aug. 11, 1999 (Reference 1)). The CCM technique is provided by Object Management Group Inc., a group of standardization in U.S.A. (see CORBA Componentsxe2x80x94Volume I: Joint Revised Submission, Object Management Group Inc., Aug. 2, 1999 (Reference 2)). The COM technique is provided by Microsoft Corporation in U.S.A. (see Understanding COM+, David S.Platt, Microsoft Press, Jun. 16, 1999, ISBNo. 7356-0666-8 (Reference 3). In the EJB technique, components are called xe2x80x9cEnterprise Beansxe2x80x9d.
One of general characteristics of components is in that the components do not directly use any system program such as transaction service and security service used by transaction programs. In order to provide a component as a more general part, a component provider mounts only a processing logic required to be reused on the component. This is because as follows. The method required for controlling such a system program varies in accordance with the transaction program using the component. Accordingly, if a logic for using the system program is mounted on the component in advance, the transaction allowed to use the component is limited so that general-purpose characteristic is lowered.
The fact that the component does not directly use the system program causes a problem when the transaction program requests the component to use the system program. To solve this problem, a container for controlling the component acts in place of the component to call the system program such as transaction service or security service. The call of the system program is performed as a part of a component controlling process. A plurality of component control methods inclusive of such system program calls are defined by the component technique while attribute values are associated with the plurality of component control methods respectively correspondingly. The container calls the system program property in accordance with the attribute value indicating one of the component control methods.
The classification of the attribute values is defined by each component technique. For example, attribute values concerning transaction control and security management are described in the EJB technique. The following six values are defined as attribute values concerning transaction control. xe2x80x9cNot Support-edxe2x80x9d: transaction control is not provided. xe2x80x9cRequiredxe2x80x9d: new transaction is added to start if there is no transaction added when the component is used. xe2x80x9cSupportedxe2x80x9d: transaction control is provided. xe2x80x9cRequiresNewxe2x80x9d: new transaction is always added to start when the component is used. xe2x80x9cMandatoryxe2x80x9d: process is terminated abnormally if there is no transaction added when the component is used. xe2x80x9cNeverxe2x80x9d: process is terminated abnormally if there is some transaction added when the component is used.
A system constructor can provide a definition file at the time of system construction to give an attribute value indicating a component control method to the container. In the EJB technique, an attribute description format called xe2x80x9cDeployment Descriptorxe2x80x9d is used for storing an attribute value in a definition file to provide the definition file to the container. Detailed information concerning the Deployment Descriptor is described in chapter 16 xe2x80x9cDeployment Descriptorxe2x80x9d of the EJB specification (Reference 1).
The way of determining the attribute value indicating a component control method and the process as a result thereof will be described below. FIG. 2 is a data flow chart showing the theory of an enterprise information system constructed by a background art. A container 100 is a program for controlling a component 110. The component 110 is a program to be used by a transaction program 120. The transaction program 120 has data 201 containing a component name (inclusive of the name of a method to be used) corresponding to the component 110 to be used, and a parameter for using the component 110 to be used. An attribute value acquisition section 103 is a program that is used by the container 100 for acquiring an attribute value indicating a component control method. The attribute value acquisition section 103 has table data 210 for holding attribute values correspondingly associated with component names (inclusive of method names). Component name (inclusive of method name)/parameter 2001 is data that is supplied into the container 100 from the transaction program 120 and then supplied from the container 100 into the attribute value acquisition section 103. Component name (inclusive of method name)/parameter/attribute value 2002 is data that is supplied into the container 100 from the attribute value acquisition section 103. Parameter 2003 is data that is supplied into the component 110 from the container 100.
A flow of processing in the background art will be described below. When a system user starts use of a transaction program 120, the transaction program 120 supplies the container 100 with a component name (inclusive of a method name) corresponding to a component 110 to be used and a parameter 210 for using the component 110 to be used. The container 100 receives component name (inclusive of method name)/parameter 2001 and outputs the component name (inclusive of method name)/parameter 2001 into the attribute value acquisition section 103. The attribute value acquisition section 103 acquires an attribute value corresponding to the component name (inclusive of method name) from the table data 210. Then, the attribute value acquisition section 103 outputs component name (inclusive of method name)/parameter/attribute value 2002 into the container 100. The container 100 carries out a process in accordance with the input attribute value. Then, the container 100 outputs parameter 2003 into the component 110 corresponding to the component name. The component 110 receives the parameter 2003 and carries out a process.
The process carried out by the container 100 in accordance with the attribute value is described in detail in Chapter 11 xe2x80x9cSupport for Transactionsxe2x80x9d and Chapter 15 xe2x80x9cSecurity Managementxe2x80x9d of the EJB specification (Reference 1).
An enterprise information system constructed by use of the aforementioned background art has been used up to now. The needs of using a component in common, however, has increased because the opportunity of processing a large number of transaction programs simultaneously on a system has increased with the advance of improvement in function of the system. If transaction programs use components by generating the components individually on a memory without sharing the components though those components are the same, system resources such as memory, etc. spent by the respective components increase as the number of transaction programs operating on a system increases. As a result, lowering of processing performance is caused due to shortage of system resources. If programs necessary for operating the system as a whole further try to acquire system resources when system resources such as memory, etc. run short, a serious failure such as system down occurs.
In the background art, however, it is impossible to change the attribute value indicating a component control method in accordance with the kind of the transaction. Hence, when there is difference between attribute values to be set by transaction programs needing to use one component in common, a problem is caused so that the component cannot be used in common. Assume now that there are two transaction programs needing to use one component in common and that one of the transaction programs sets the transaction attribute value of the component to xe2x80x9cMandatoryxe2x80x9d. Even in the case where the other transaction program tries to set the attribute value of the component to xe2x80x9cNeverxe2x80x9d, the attribute value is disabled from being changed by the transaction program using the component. Hence, even in the case where the transaction program uses the component, the container uses the system program by a method of use corresponding to the attribute value xe2x80x9cMandatoryxe2x80x9d. Incorrect transaction control may cause disappearance of protected data. Incorrect security management may cause stealing of data. If component control is not performed correctly in accordance with the attribute value required of the component, a great deal of loss as described above is given to the enterprise information system user.
An object of the present invention is to provide a program control method and system in which the attribute value used for component control can be changed in accordance with the kind of the transaction.
The foregoing object of the present invention can be achieved by a program control method comprising the steps of: holding transaction identifying information for identifying a transaction to be executed by a transaction program, a component name for specifying a component to receive data from the transaction program and an attribute value indicating a method for controlling the component while correspondingly associating them with one another; inputting data containing component name, parameter to be sent to a component corresponding to the component name and transaction identifying information; and controlling the component corresponding to the input component name on the basis of the input transaction identifying information and the held attribute value corresponding to the input component name to thereby output the input parameter into the component. Hence, the attribute value used for component control can be changed in accordance with the kind of the transaction.